/**
 * 
 */
package com.aibili.pojo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 活动参与的用户表
 * 
 * @author qiuch
 * 
 */
@Entity
@Table(name = "t_event_user")
public class EventUser implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6734740117231616299L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", length = 11, nullable = false)
	private long id;

	@OneToOne(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER, targetEntity = UserInfo.class)
	@JoinColumn(name = "user_id", nullable = false, updatable = false)
	private UserInfo user;// 参与的用户

	@Column(name = "event_id", length = 11, nullable = false)
	private long event_id;// 活动id

	@Column(name = "gift_id", length = 11, nullable = false)
	private long gift_id;// 送的礼物id----0为报名参加活动 >0为给活动送礼

	@Column(name = "gift_name", length = 11, nullable = false)
	private String gift_name;// 送的礼物名字

	@Column(name = "join_time", columnDefinition = "TIMESTAMP default CURRENT_TIMESTAMP")
	private Date join_time;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public UserInfo getUser() {
		return user;
	}

	public void setUser(UserInfo user) {
		this.user = user;
	}

	public long getEvent_id() {
		return event_id;
	}

	public void setEvent_id(long event_id) {
		this.event_id = event_id;
	}

	public long getGift_id() {
		return gift_id;
	}

	public void setGift_id(long gift_id) {
		this.gift_id = gift_id;
	}

	public String getGift_name() {
		return gift_name;
	}

	public void setGift_name(String gift_name) {
		this.gift_name = gift_name;
	}

	public Date getJoin_time() {
		return join_time;
	}

	public void setJoin_time(Date join_time) {
		this.join_time = join_time;
	}

}
